from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # 1、XPATH text定位
    def sousuokuang(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        ele=self.driver.webdriver(loc)
        return ele
    #2、CLASS_NAME定位
    def shurukuang(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.driver.webdriver(loc)
        return ele
    #3、XPATH resource-id定位
    def fanhuianniu(self):
        loc=(By.XPATH,'//android.widget.RelativeLayout[@resource-id="com.xiachufang:id/img_container"]')
        ele=self.driver.webdriver(loc)
        return ele
    #4、ID定位
    def gengduo(self):
        loc=(By.ID,'com.xiachufang:id/navigation_img_view')
        ele=self.driver.webdriver(loc)
        return ele
    #5、XPATH
    def sousuoanniu(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.driver.webdriver(loc)
        return ele
    #6、XPATH UiSelecort定位
    def qingkong(self):
        loc=(By.XPATH,"new UiSelecort.() text('清空')")
    #白灼菜心
    def baizhuocaixin(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/common_first_text" and @text="白灼菜心"]')
        ele=self.driver.webdriver(loc)
        return ele